<%--
  Created by IntelliJ IDEA.
  User: 李威
  Date: 2021/10/5
  Time: 13:35
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<!DOCTYPE html>
<html lang="en">
<head>
    <title>付款页面</title>
    <link href="../css/order/forth_step_commit.css" rel="stylesheet">
    <link href="../css/common.css" rel="stylesheet">
    <script src = "${pageContext.request.contextPath}/js/jquery-3.3.1.min.js"></script>

</head>
<body>
${serverResponse.data.myOrderId}
<div class="w1180">
    <div class="header">
        <img src="../images/logo.png" alt="../images/logo.png">
        <div class="content">
            <a href="">400-888-6608</a>
        </div>
        <div class="help_center">
            <a href="">帮助中心</a>
            <span>|</span>
        </div>
        <div class="help_center">
            <a href="">我的小橘</a>
            <span>|</span>
        </div>
        <div class="user">
            <span>李威</span>
            <a href="">[退出]</a>
            <span class="user-span">|</span>
        </div>
    </div>
    <div class="col-main">
        <div id="crumbs">
            <div class="crumbs-bd">
                当前位置:
                <a href="">我的小橘</a>
            </div>
        </div>
        <div id="content">
            <!--                侧边栏-->
            <div class="col-sub">
                <dl class="sub-nav">
                    <dt>我的订单</dt>
                    <dd><a href="">订单管理</a></dd>
                    <dt>我的资产</dt>
                    <dd><a href="">账户余额</a></dd>
                    <dd><a href="">我的优惠券</a></dd>
                    <dd><a href="">我的收藏</a></dd>
                    <dt>个人中心</dt>
                    <dd><a href="">用户信息</a></dd>
                    <dd><a href="">申请注销账户</a></dd>
                </dl>
            </div>
            <div class="col-main">
                <div class="my-payment">
                    <div class="payment-order">
                        <span class="payment-tips" id = jump>15</span>
                        <span class="payment-tips">秒，逾期订单将提交失败</span>
                        <div class="payment-info">
                            <div class="header">
                                <p>
                                    <b>请您支付订单总额</b><i>¥</i><em>${serverResponse.data.myOrderPrice}
                                </em>取车时请务必携带本人<span>有效身份证、驾照正副本、本人信用卡</span>
                                </p>
                            </div>
                        </div>
                        <div class="payment-info-bottom">
                            <p>
                                <b>订单号：<a href="">${serverResponse.data.myOrderNumber}</a></b>
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                <b>支付方式：网上支付</b>
                            </p>
                        </div>

                    </div>
                    <div class="pay-online-wrap">
                        <div class="pay-online-title">选择付款方式</div>
                        <div class="pay-online-tabbox">

                            <div class="pay-online-tab">网银支付</div>
                            <div class="active">个人余额</div>
                            <div class="active" id="pay-online-tab">代金券</div>
                        </div>
                        <div class="pay-online-box">
                            <div class="pay-box1">
                                <ul class="bank-list">
                                    <li><label><input name="Payway" type="radio" value="Alipay"><img src="../images/alipay.png"></label></li>
                                </ul>
                                <div class="payment-btnbox">
                                    <form action="${pageContext.request.contextPath}/alipay/goAlipay" method="post">
                                        <input type="text" value="${serverResponse.data.myOrderId}" name="myOrderId">
                                        <input type="text" name="myOrderPrice" value="${serverResponse.data.myOrderPrice}">
                                        <input type="text" name="carId" value="${serverResponse.data.carId}">
                                        <input type="text" name="myOrderLeaseDays" value="${serverResponse.data.myOrderLeaseDays}">
                                        <input type="text" name="custId" value="${serverResponse.data.custId}">

                                        <input type="submit" value="下一步" >
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="step3-banner">
                        <div class="barcode">
                            <div class="barcode-info">
                                <img src="../images/erweima.png">
                                <div class="border-right-empty">
                                    <span></span>
                                </div>
                            </div>
                            <p>扫描二维码，下载APP<br>
                                第一时间查询你的订单
                            </p>
                        </div>
                    </div>
                </div>
            </div>
        </div>


    </div>
    <!--底部页面-->
    <div class="footer">
        <div class="footer-box clear_float">
            <div class="footer-left">
                <p>
                    <a href="" >关于小橘</a>
                    |
                    <a href="" >移动客户端</a>
                    |
                    <a href="" >帮助中心</a>
                    |
                    <a href="" >建议专区</a>
                    |
                    <a href="" >联系我们</a>
                    |
                    <a href="" >友情链接</a>
                    | &nbsp;投诉通道：400-821-1608 &nbsp;
                </p>
                <p>
                    Copyright © 2007 - 2021 苏州小橘信息技术服务有限公司
                    <a href="" >ICP证：沪B2-20140130</a>
                </p>
            </div>
            <div class="footer-right">
                <a href="">
                    <img src="../images/footer_right_first.png">
                </a>
                <a href="">
                    <img src="../images/footer_right_second.png">
                </a>
                <a href="">
                    <img src="../images/footer_right_third.png">
                </a>
                <a href="">
                    <img src="../images/footer_right_forth.png">
                </a>
            </div>
        </div>
    </div>
</div>

<script >
    var myOrderId = "${serverResponse.data.myOrderId}";
    var custId = "${serverResponse.data.custId}";
    var carId = "${serverResponse.data.carId}";
    var storeBorrowId = "${serverResponse.data.storeBorrowId}";
    var couponId = "${serverResponse.data.couponId}";
    var myOrderNumber = "${serverResponse.data.myOrderNumber}";
    var storeReturnId = "${serverResponse.data.storeReturnId}";

    var getCarTime = "${serverResponse.data.getCarTime}";

    var returnCarTime = "${serverResponse.data.returnCarTime}";

    var getterName = "${serverResponse.data.getterName}";
    var getterIdCard = "${serverResponse.data.getterIdCard}";
    var getterDriverLicenseStartTime = "${serverResponse.data.getterDriverLicenseStartTime}";
    var getterDriverLicenseEndTime = "${serverResponse.data.getterDriverLicenseEndTime}";

    var getterDriverLicenseType = "${serverResponse.data.getterDriverLicenseType}";
    var myOrderTime = "${serverResponse.data.myOrderTime}";

    var myOrderLeaseDays = "${serverResponse.data.myOrderLeaseDays}";
    var carNumber = "${serverResponse.data.carNumber}";
    var myOrderPrice = "${serverResponse.data.myOrderPrice}";
    var status = "${serverResponse.data.status}";
    var other1 = "${serverResponse.data.other1}";
    var other2 = "${serverResponse.data.other2}";

    function countDown(secs){
        //倒计时秒数
        jump.innerText = secs;
        if(secs > 0){
            secs--;
            setTimeout("countDown(" + secs + " )",1000);
            console.log(secs);
        }else {  //倒计时结束修改订单状态
            console.log("订单状态失效");
            $.ajax({
                url:'${pageContext.request.contextPath}/updateOrderStatus4',
                type:'PUT',
                data:{
                    "myOrderId": myOrderId,
                    "custId": custId,
                    "carId": carId,
                    "storeBorrowId": storeBorrowId,
                    "couponId": couponId,
                    "myOrderNumber": myOrderNumber,
                    "storeReturnId": storeReturnId,
                    "getCarTime": new Date(getCarTime),
                    "returnCarTime": new Date(returnCarTime),
                    "getterName": getterName,
                    "getterIdCard": getterIdCard,
                    "getterDriverLicenseStartTime": new Date(getterDriverLicenseStartTime),
                    "getterDriverLicenseEndTime": new Date(getterDriverLicenseEndTime),
                    "getterDriverLicenseType": getterDriverLicenseType,
                    "myOrderTime": new Date(myOrderTime),
                    "myOrderLeaseDays": myOrderLeaseDays,
                    "carNumber": carNumber,
                    "myOrderPrice": myOrderPrice,
                    "status": status,
                    "other1":other1,
                    "other2": other2
                },
                dataType:'json',
                success: function() {
                    window.location.href = '${pageContext.request.contextPath}';
                }
            });

        }
    }
    countDown(300);



</script>
</body>
</html>
